package com.uwlaser.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.uwlaser.base.CommonModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
* @author mx
* @date 2022-08-24
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("spc_data_course_param")
public class SpcDataCourseParam extends CommonModel<SpcDataCourseParam> implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(type= IdType.AUTO)
    private Long id;


    @ApiModelProperty(value = "产品SN")
    private String productSn;

    @ApiModelProperty(value = "产品型号")
    private String productCode;

    @ApiModelProperty(value = "产品类型")
    private String productType;

    @ApiModelProperty(value = "订单编号")
    private String orderCode;

    @ApiModelProperty(value = "工单编号")
    private String workOrderCode;

    @ApiModelProperty(value = "产线编号")
    private String lienCode;

    @ApiModelProperty(value = "工段编号")
    private String sectionCode;

    @ApiModelProperty(value = "工位编号")
    private String stationCode;

    @ApiModelProperty(value = "工序编号")
    private String operationCode;

    @ApiModelProperty(value = "设备编号")
    private String deviceCode;

    @ApiModelProperty(value = "判断结果 0不合格 1合格")
    private String paramResult;

    @ApiModelProperty(value = "参数编码")
    private String paramCode;

    @ApiModelProperty(value = "参数名称")
    private String paramName;

    @ApiModelProperty(value = "参数值")
    private Double paramValue;

    @ApiModelProperty(value = "判断范围")
    private String paramRange;

    @ApiModelProperty(value = "参数单位")
    private String paramUnit;

    @ApiModelProperty(value = "测试顺序")
    private Integer paramNumber;

    @ApiModelProperty(value = "spc主表id")
    private Integer spcMainId;

    @ApiModelProperty(value = "过程表id")
    private String cpId;

    public void copyFrom(SpcDataCourseParam source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
